Skip to content

feat(document-api): support wrapping text ranges via contentControls.create (SD-2566)#2815

Merged
caio-pizzol merged 4 commits intomainfrom
caio/sd-2566-featdocument-api-support-wrapping-text-ranges-in-content
Apr 14, 2026
Merged

feat(document-api): support wrapping text ranges via contentControls.create (SD-2566)#2815
caio-pizzol merged 4 commits intomainfrom
caio/sd-2566-featdocument-api-support-wrapping-text-ranges-in-content

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Add optional at field (SelectionTarget) to CreateContentControlInput, enabling callers to wrap arbitrary text ranges in content controls without dropping down to editor internals.

  • Add at?: SelectionTarget to CreateContentControlInput — mutually exclusive with target
  • Validate shape via existing isSelectionTarget guard
  • Resolve SelectionTarget → PM positions via resolveSelectionTarget, set TextSelection, then delegate to insertStructuredContentInline/Block
  • 4 new test cases covering mutual exclusivity, invalid shapes, and valid usage

Closes SD-2566

…create (SD-2566)

Add optional `at` field (SelectionTarget) to CreateContentControlInput,
enabling callers to wrap arbitrary text ranges in content controls
without dropping down to editor internals. Mutually exclusive with the
existing `target` field.
@linear
Copy link
Copy Markdown

linear bot commented Apr 14, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15f03fece8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

… at field

- Re-acquire editor command after at selection dispatch to avoid stale
  state bug (CommandService captures state at access time)
- Reorder validation so at/target mutual exclusivity check runs before
  target shape validation for clearer error messages
- Document at + content interaction in JSDoc
- Extract shared validAt constant in tests
The objectSchema uses additionalProperties: false, so contract-driven
callers (CLI, SDK) would reject payloads with the new at field.
@caio-pizzol caio-pizzol enabled auto-merge April 14, 2026 20:32
@caio-pizzol caio-pizzol self-assigned this Apr 14, 2026
@caio-pizzol caio-pizzol added this pull request to the merge queue Apr 14, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 14, 2026
@caio-pizzol caio-pizzol enabled auto-merge April 14, 2026 20:37
@caio-pizzol caio-pizzol added this pull request to the merge queue Apr 14, 2026
Merged via the queue into main with commit c825717 Apr 14, 2026
51 of 54 checks passed
@caio-pizzol caio-pizzol deleted the caio/sd-2566-featdocument-api-support-wrapping-text-ranges-in-content branch April 14, 2026 20:44
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in vscode-ext v2.3.0-next.16

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in @superdoc-dev/react v1.2.0-next.13

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in esign v2.3.0-next.16

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in template-builder v1.5.0-next.16

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in superdoc v1.26.0-next.16

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in superdoc-cli v0.7.0-next.17

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in superdoc-sdk v1.6.0-next.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant